import request from '@/utils/request'

// 查询数据预处理列表
export function listPretreatment(query) {
  return request({
    url: '/bearing/pretreatment/list',
    method: 'get',
    params: query
  })
}

// 获取所有数据预处理信息
export function getPretreatmentDataPageAll() {
  return request({
    url: '/bearing/pretreatment/getPretreatmentDataPageAll',
    method: 'get'
  })
}

// 分页获取所有数据预处理信息
export function getPretreatmentDataPage(query) {
  return request({
    url: '/bearing/pretreatment/getPretreatmentDataPage',
    method: 'get',
    params: query
  })
}

// 查询数据预处理详细
export function getPretreatment(id) {
  return request({
    url: '/bearing/pretreatment/' + id,
    method: 'get'
  })
}

// 加载excel数据到redis
export function readAndStoreExcelDataToRedis(path) {
  return request({
    url: '/bearing/pretreatment/readAndStoreExcelDataToRedis',
    method: 'post',
    data: {
      path: path
    }
  })
}

// 新增数据预处理
export function addPretreatment(data) {
  return request({
    url: '/bearing/pretreatment',
    method: 'post',
    data: data
  })
}

// 修改数据预处理
export function updatePretreatment(data) {
  return request({
    url: '/bearing/pretreatment',
    method: 'put',
    data: data
  })
}

// 删除数据预处理
export function delPretreatment(id) {
  return request({
    url: '/bearing/pretreatment/' + id,
    method: 'delete'
  })
}
